package main

import "fmt"

func main() {
	arrF := []float32{1.5, 2.3, 3.9, 4.1, 5.9}
	sum := Sum(arrF)
	fmt.Println("Sum(arrF) : ", sum)
	arrI := []int{1, 2, 3, 4, 5}
	suma, average := SumAndAverage(arrI)
	fmt.Printf("SumAndAverage(arrI) : %d  %f \n", suma, average)

}

func Sum(arrF []float32) (sum float32) {
	for _, v := range arrF {
		sum += v
	}
	return
}

func SumAndAverage(arrF []int) (sum int, average float32) {
	for _, v := range arrF {
		sum += v
	}
	average = float32(len(arrF))
	return
}
